const Sequelize = require('sequelize')
const { db } = require('../database/db')
const { User } = require("../models.js")

const UserAddress = db.define('user_address',{
	id:{
		type: Sequelize.INTEGER,
		primaryKey:true,
		autoIncrement:true
	},
	user_id:{
		 type: Sequelize.STRING,
		 allowNull: false
	},
	province:{
		type:Sequelize.STRING,
		comment:"省"
	},
	city:{
		type:Sequelize.STRING,
		comment:"市"
	},
	district:{
		type:Sequelize.STRING,
		comment:"区"
	},
	address:{
		type:Sequelize.STRING,
		comment:"详细地址"
	},
	zip:{
		type:Sequelize.STRING,
		comment:"邮编"
	},
	name:{
		type:Sequelize.STRING,
		comment:"名字"
	},
	phone:{
		type:Sequelize.STRING,
		comment:"电话"
	},
	default:{
		type:Sequelize.INTEGER,
		comment:"是否默认，0否1是"
	} 
})



module.exports = UserAddress;